package 单例模式;

/**
 * 内部类方式(线程安全):
 * 当使用的时候才会创建
 */
public class Singleton4 {

    private Singleton4() {

    }

    public static class InnerHolder {
        public static final Singleton4 intance = new Singleton4();
    }

    public static Singleton4 getInstance() {
        return InnerHolder.intance;
    }
}
